#include "RobertCoreGenerator.h"



RobertCoreGenerator::RobertCoreGenerator () : LinearCoreGenerator (true, 2)
{

}



Core< float > RobertCoreGenerator::getCore (int size, int direction)
{
	float c[2][2] = { { 0, -1 }, { 1, 0 } };
	Core< float > core (QSize (2, 2));
	for (int i = 0; i < getSize (); ++i)
		for (int j = 0; j < getSize (); ++j) {
			int x = (direction == 0 ? j : i);
			int y = (direction == 0 ? i : j);
			core(x, y) = c[i][j];
		}
	return core;
}
